package dataserver.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import dataserver.pojo.SceneDevice;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.util.Date;


/**
 * 类:设备表
 */
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Tag(name = "设备请求实体")
public class SceneDeviceDTO extends Base {
   /**
    * 站场id
    */
   @Schema(name = "站场id", example = "2")
   @JsonProperty("stationId")
   private String stationId;

   /**
    * 站场名称
    */
   @Schema(name = "站场名称", example = "301D")
   @JsonProperty("stationName")
   private String stationName;

   /**
    * UE场景中名称
    */
   @Schema(name = "UE场景中名称", example = "StaticMeshActor_2810")
   @JsonProperty("unrealName")
   private String unrealName;

   /**
    * 模型名称
    */
   @Schema(name = "模型名称", example = "301D_DX_01")
   @JsonProperty("viewName")
   private String viewName;

   /**
    * 系统模型编号
    */
   @Schema(name = "系统模型编号")
   @JsonProperty("deviceCode")
   private String deviceCode;

   /**
    * 系统模型名称
    */
   @Schema(name = "系统模型名称")
   @JsonProperty("deviceName")
   private String deviceName;

    /**
     * 经度
     */
    @Schema(name = "经度", example="106.66333865949751")
    @JsonProperty("x")
    private Double x;
    /**
     * 纬度
     */
    @Schema(name = "纬度", example="38.20326158833742")
    @JsonProperty( "y")
    private Double y;
    /**
     * 高度
     */
    @Schema(name = "高度", example="7.7")
    @JsonProperty("z")
    private Float z;

    public SceneDevice getSceneDevice() {
        SceneDevice pojo = new SceneDevice();
        if (this.getId() != null) pojo.setId(this.getId());
        if (this.stationId != null) pojo.setStationId(this.stationId);
        if (this.stationName != null) pojo.setStationName(this.stationName);
        if (this.unrealName != null) pojo.setUnrealName(this.unrealName);
        if (this.viewName != null) pojo.setViewName(this.viewName);
        if (this.deviceCode != null) pojo.setDeviceCode(this.deviceCode);
        if (this.deviceName != null) pojo.setDeviceName(this.deviceName);
        pojo.setUpdateTime(new Date());
        return pojo;
    }
}